package com.yyge.common.context;
//创建context包,创建redis和jwt的配置类

import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@ConfigurationProperties(prefix = "redis-key" )
@Component
@Setter
public class RedisContext {
   //yml 配置 : redis-key: captcha:
   //验证前缀
   private String captcha = "back:captcha:";

   //yml 配置 : redis-key: jwt:
   //JWT令牌前缀
   private String jwt = "back:jwt:";

   /**
   * 获取验证码的 key: 前缀 +uuid
   * @param uuid
   * @return
   */
   public String getCaptchaKey (String uuid) {
     return captcha + uuid ;
  }


   /**
   * 获取 jwt 的key: 前缀 +uuid
   * @param uuid
   * @return
   */
   public String getJWTKey (String uuid) {
     return jwt + uuid ;
  }
}
